let router_title,
    site_title

function set_title() {
    let title
    if (!router_title && !site_title) {
        title = 'loading···'
    } else if (!router_title) {
        title = site_title
    } else if (!site_title) {
        title = router_title
    } else {
        title = router_title + '-' + site_title
    }
    document.title = title
}

export default {
    set_router_title(title) {
        router_title = title
        set_title()
    },
    set_site_title(title) {
        site_title = title
        set_title()
    }
}